package net.oschina.simpleplus.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import net.oschina.simpleplus.ser.PostSer;

@Controller
public class IndexCtrl {
	@Autowired
	private PostSer postSer;

	@RequestMapping("/")
	public String index(ModelMap mm){
		mm.addAttribute("posts", postSer.findPostsByPage(1));
		return "index";
	}

	@RequestMapping("/post")
	public String post(ModelMap mm){
		//mm.addAttribute("posts", postSer.findPostsByPage(1));
		return "post";
	}
}
